home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows News 2006 October
/
wn148cd2.iso
/
Windows
/
Travailler
/
QuickZip
/
quickzip_460013.exe
/
{app}
/
Scripts
/
RelativeRestore.akp
< prev
next >
Wrap
Text File
|
2003-02-07
|
2KB
|
76 lines
//Compare and update the files in <Dir1> and <Dir2>.
//Backup overwrited file to <BackupChanges>.
const Directory2Backup = 'c:\FoldertoRestore\';
ZipDirectory = 'c:\ZipDir\';
var
Path1,ZipPath : String;
var aForm : TForm;
Button1,Button2,ConfirmButton : TButton;
Edit1,Edit2 : TEdit;
Label1,Label2 : TLabel;
procedure Button1Click(sender: TObject);
var k : string;
begin
k := AskDirDialog(Edit1.text);
if k <> '' then
Edit1.text := k;
end;
procedure Button2Click(sender: TObject);
var k : string;
begin
k := AskDirDialog(Edit2.text);
if k <> '' then
Edit2.text := k;
end;
procedure Continueclick(sender: TObject);
begin
aForm.Close;
end;
function AskDirectory : boolean;
begin
Result := False;
aForm := New_Form(100,100,500,200,'Please Configure and press Continue');
Label1 := new_Label(aForm,10,40,'Restore Directory : ');
Edit1 := new_Edit(aForm,140,40,200,20,Directory2Backup);
Button1 := New_Button(aForm, 350, 40, 100, 20, 'Browse');
Button1.OnClick := @Button1Click;
Label2 := new_Label(aForm,10,10,'Backuped (Zip) Directory : ');
Edit2 := new_Edit(aForm,140,10,200,20,ZipDirectory);
Button2 := New_Button(aForm, 350, 10, 100, 20, 'Browse');
Button2.OnClick := @Button2Click;
ConfirmButton := New_Button(aForm, 350, 130, 100, 30, 'Continue');
ConfirmButton.Default := True;
ConfirmButton.ModalResult := mrOK;
ConfirmButton.OnClick := @Continueclick;
show_Form(aForm);
if aForm.modalResult = Mrok then
begin
Path1 := AppendSlash(Edit1.text);
ZipPath := AppendSlash(Edit2.text);
Result := true;
end;
end;
procedure ReStoreBackup;
var i : integer;
begin
i := 0;
Edit2.text := Appendslash(Edit2.text);
While fileexists(Edit2.text+'Backup'+inttostr(i)+'.zip') do
begin
MakeDir(Edit1.text);
open(Edit2.text+'Backup'+inttostr(i)+'.zip');
useextrpath(true);
Extract('*.*',Edit1.text);
Close;
i := i + 1;
end;
end;
begin
if AskDirectory then
ReStoreBackup;
Writeln('Completed!');
end.